import require from '../utils/require'

export function queryChatMessage(userId: number, targetId: number) {
  const params = {
    userId: userId,
    targetId: targetId
  }

  return require.get('/message/queryChatHistory', params)
}

export function getUserResentMessage(userId: number, searchContent: string) {
  if (searchContent) {
    return require.get('/message/getUserResentMessage', {
      userId: userId,
      searchContent: searchContent
    })
  } else {
    return require.get('/message/getUserResentMessage', { userId })
  }
}
